package com.evaluationsystem.system.controller;

import com.evaluationsystem.system.serivce.CustomerAssessmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
@RequestMapping("customerAssessment")
@Api(tags = "客户评定人员 CRUD 接口",value = "20204-17,Gdy")
public class CustomerAssessmentController {

    @Autowired
    CustomerAssessmentService service;

    @GetMapping()
    @ApiOperation("客户评定页面跳转接口")
    public String customerAssessmentHtml(){
        return "system/customerAssessment/customerAssessment";
    }

    @ResponseBody
    @ApiOperation(value = "客户评定组 树形结构数据查询 接口",notes = "2020-4-19、gdy")
    @PostMapping("treeDatas")
    public Map<String,Object> appraisalSelectDatas(){
        Map<String,Object> res = service.treeDatas();
        return res;
    }

    @ResponseBody
    @ApiOperation(value = "客户评定组 新增 接口",notes = "2020-4-19、gdy")
    @ApiImplicitParam(name = "param",value = "{vcustomername:客户评定组名称}",required = true,paramType = "json")
    @PostMapping("treeDatasAdd")
    public Map<String,Object> treeDatasAdd(@RequestBody Map<String,Object> param){
        Map<String,Object> res = service.treeDatasAdd(param);
        return res;
    }

    @ResponseBody
    @ApiOperation(value = "客户评定组 修改 接口",notes = "2020-4-19、gdy")
    @ApiImplicitParam(name = "param",value = "{vcustomerid:主键ID,vcustomername:客户评定组名称}",required = true,paramType = "json")
    @PostMapping("treeDatasUpdata")
    public Map<String,Object> treeDatasUpdata(@RequestBody Map<String,Object> param){
        Map<String,Object> res = service.treeDatasUpdata(param);
        return res;
    }

    @ResponseBody
    @ApiOperation(value = "客户评定组 删除 接口",notes = "2020-4-19、gdy")
    @ApiImplicitParam(name = "param",value = "{vcustomerid:主键ID}",required = true,paramType = "json")
    @PostMapping("treeDatasDel")
    public Map<String,Object> treeDatasDel(@RequestBody Map<String,Object> param){
        Map<String,Object> res = service.treeDatasDel(param);
        return res;
    }


    @ResponseBody
    @ApiOperation(value = "未被选中的员工 Table 数据 接口",notes = "2020-4-19、gdy")
    @ApiImplicitParam(name = "param",value = "{page=1, limit=10}",required = true,paramType = "json")
    @PostMapping("evaluatMemberFalse")
    public Map<String,Object> evaluatMemberFalse(@RequestBody Map<String,Object> param){
        Map<String,Object> res = service.evaluatMemberFalse(param);
        return res;
    }

    @ResponseBody
    @ApiOperation(value = "已选中的员工 Table 数据 接口",notes = "2020-4-19、gdy")
    @ApiImplicitParam(name = "param",value = "{vpositionid=tcustomerassessment表主键id}",required = true,paramType = "json")
    @PostMapping("evaluatMemberTure")
    public Map<String,Object> evaluatMemberTure(@RequestBody Map<String,Object> param){
        Map<String,Object> res = service.evaluatMemberTure(param);
        return res;
    }

    @ResponseBody
    @ApiOperation(value = "添加 已选中的员工 接口",notes = "2020-4-19、gdy")
    @ApiImplicitParam(name = "param",value = "{vpositionid=tcustomerassessment表主键id, FalseArr=新增数据}",required = true,paramType = "json")
    @PostMapping("evaluatMemberTrueAdd")
    public Map<String,Object> evaluatMemberTrueAdd(@RequestBody Map<String,Object> param){
        Map<String,Object> res = service.evaluatMemberTrueAdd(param);
        return res;
    }

    @ResponseBody
    @ApiOperation(value = "删除 已选中的员工 接口",notes = "2020-4-19、gdy")
    @ApiImplicitParam(name = "param",value = "{vpositionid=tcustomerassessment表主键id, FalseArr=删除数据}",required = true,paramType = "json")
    @PostMapping("evaluatMemberTrueDel")
    public Map<String,Object> evaluatMemberTrueDel(@RequestBody Map<String,Object> param){
        Map<String,Object> res = service.evaluatMemberTrueDel(param);
        return res;
    }



}
